// cookie.set（' name '，' value '）;
require(['./config'], () => {
    require(['cookie'], () => {
        class register {
            constructor() {
                this.getData()
            }
            getData() {
                $('#register').on('click', function () {
                    let name = $('#username').val()
                    let password = $('#passw1').val()
                    console.log(name, password)
                    if (!name == "" || !name == null || !name == undefined) {
                        if (!password == "" || !password == null || !password == undefined) {
                            $.cookie('info', [name, password], { path: '/' });
                            if ($.cookie('info')) {
                                alert('注册成功')
                                location.href = "/html/login.html"
                            } else {
                                alert('注册失败')
                                $('#username').val("")
                                $('#passw1').val("")
                            }
                        } else {
                            alert('密码不能为空')
                        }
                    } else {
                        alert('账号不能为空')
                    }
                    //判断cookie中是否有该值
                });
            }
        }
        new register()
    })
})